from rest_framework import serializers
from AskDoctor.models import (
    AskDoctorClassificationModel,
    AskDoctorDepartmentModel,
    DoctorPatientModel,
    PatientProfile,
    PatientReviewModel,
    DoctorModel
)

# 医生简介序列化器
class DoctorSerializer(serializers.ModelSerializer):
    class Meta:
        model = DoctorModel
        fields = [
            'id', 
            'doctor_name', 
            'rating', 
            'price', 
            'proficient_direction',
            'doctor_pictures', 
            'doctor_title', 
            'doctor_specialty', 
            'education_background', 
            'practice_experience', 
            'academic_achievements', 
            'hospital',
            'recommend_home'
        ]

# 患者简介序列化器
class PatientProfileSerializer(serializers.ModelSerializer):
    class Meta:
        model = PatientProfile
        fields = [
            'id', 
            'name', 
            'patient_pictures', 
            'gender', 
            'birth_date', 
            'age', 
            'contact_number', 
            'address', 
            'id_number', 
            'insurance_info', 
            'emergency_contact', 
            'weight', 
            'height', 
            'blood_type', 
        ]

# 医患问答序列化器
class DoctorPatientSerializer(serializers.ModelSerializer):
    class Meta:
        model = DoctorPatientModel
        fields = [
            'id', 
            'question', 
            'answer', 
            'date', 
            'recommend_home', 
            'patient', 
            'doctor'
        ]

# 患者评价序列化器
class PatientReviewSerializer(serializers.ModelSerializer):
    class Meta:
        model = PatientReviewModel
        fields = [
            'id', 
            'content', 
            'rating', 
            'patient', 
            'doctor'
        ]


# 问医生序列化器
class AskDoctorClassificationSerializer(serializers.ModelSerializer):
    
    class Meta:
        model = AskDoctorClassificationModel
        fields = [
            'id', 
            'classification_name'
        ]

# 问医生序列化器
class AskDoctorDepartmentSerializer(serializers.ModelSerializer):
    
    class Meta:
        model = AskDoctorDepartmentModel
        fields = [
            'id', 
            'askDoctor_department', 
            'introduction',
            'askDoctor_classification'
        ]